package com.yiwei.jmx.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.RecyclerView;
import android.widget.ImageView;
import android.widget.TextView;

import com.yiwei.jmx.R;
import com.yiwei.jmx.adapter.WithdrawDetailAdapter;
import com.yiwei.jmx.base.BaseActivity;
import com.yiwei.jmx.view.V19FrameLayout;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * Created by xsooy-pc on 17-12-8.
 */

public class WithdrawListActivity extends BaseActivity {


    @BindView(R.id.btn_back)
    ImageView btnBack;
    @BindView(R.id.txt_title)
    TextView txtTitle;
    @BindView(R.id.btn_wechat)
    ImageView btnWechat;
    @BindView(R.id.layout_title)
    V19FrameLayout layoutTitle;
    @BindView(R.id.list)
    RecyclerView list;
    @BindView(R.id.refresh)
    SwipeRefreshLayout refresh;
    private Unbinder unbiner;
    private WithdrawDetailAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_withdraw_list);
        initBar();
        setBarClick();
        unbiner = ButterKnife.bind(this);
        init();
    }

    private void init() {
        txtTitle.setText("提现明细");
        adapter = new WithdrawDetailAdapter(this);
        adapter.setOnChooseListener(new WithdrawDetailAdapter.OnChooseListener() {
            @Override
            public void onSuccess(String id) {
                Intent intent = new Intent(WithdrawListActivity.this, WithdrawDetailActivity.class);
                intent.putExtra("id", id);
                startActivity(intent);
            }
        });
        list.setAdapter(adapter);

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        unbiner.unbind();
        unbiner = null;
    }
}
